/**
 * Below is a sample adapter for connecting with a webservice.
 */


var myshopAdapter={
      
    fetch:function(item,callback){   
         
        $.get(BASE_URL+"mytickets_list?id="+localStorage.getItem("userID"),
            function(obj){                
                obj=JSON.parse(obj); 
                if(callback)  
                    callback(obj);
                
            }
        );
            
        
    },
    fetchAll:function(id,callback){
        
        $.get(BASE_URL+"most_view",
            function(obj){
                
                obj=JSON.parse(obj);
                if(callback)
                    callback(obj);
            }
        );
    },
}
 

Myshop =  $.mvc.model.extend("myshop",{
    validate:function(opts){
        if(opts&&opts.trigger)
            return "error validating";
        return true;
    },
    productID: '',
    productCode: '',
    productName: '',
    description: '' 
}, myshopAdapter);

var myshop = new Myshop();
  
 